﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace ChinaTax.LeQi
{
    public class QueryRedConfirmListRequest : Request<QueryRedConfirmListResponse>
    {
        public QueryRedConfirmListRequest()
        {
            ServiceCode = "CXQDHZQRDLB";
        }

        [JsonProperty("xsfnsrsbh")]
        public string TaxNo { get => LeQiConfig.TaxNo; }

        [JsonProperty("yhjslx")]
        public string RoleType { get; set; }

        [JsonProperty("xsfmc")]
        public string SellerName { get; set; }

        [JsonProperty("gmfmc")]
        public string PurchaserName { get; set; }

        [JsonProperty("gmfnsrsbh")]
        public string PurchaserTaxNo { get; set; }

        [JsonProperty("lrfsf")]
        public string InputParty { get; set; }

        [JsonProperty("lrrqq")]
        public string BeginDate { get; set; }

        [JsonProperty("lrrqz")]
        public string EndDate { get; set; }

        [JsonProperty("lzfpdm")]
        public string BlueInvoiceCode { get; set; }

        [JsonProperty("lzfphm")]
        public string BlueInvoiceNumber { get; set; }

        [JsonProperty("hzfpxxqrdbh")]
        public string RedConfimNo { get; set; }

        [JsonProperty("hzqrxxztDm")]
        public string RedConfimStatus { get; set; }

        [JsonProperty("fppzDm")]
        public string InvoiceType { get; set; }

        [JsonProperty("pageNumber")]
        public int PageNumber { get; set; } = 1;

        [JsonProperty("pageSize")]
        public int PageSize { get; set; } = 100;
    }

    public class QueryRedConfirmListResponse : Response
    {
        [JsonProperty("hzqrxxList")]
        public RedConfirmList List { get; set; }
    }

    public class RedConfirmList
    {
        [JsonProperty("pageNumber")]
        public int PageNumber { get; set; }

        [JsonProperty("pageSize")]
        public int PageSize { get; set; }

        [JsonProperty("total")]
        public int TotalCount { get; set; }

        [JsonProperty("list")]
        public List<RedConfirmInfo> List { get; set; }
    }

    public class RedConfirmInfo
    {
        [JsonProperty("uuid")]
        public string UUID { get; set; }

        [JsonProperty("hzfpxxqrdbh")]
        public string RedConfirmNo { get; set; }

        [JsonProperty("lrfsf")]
        public string InputParty { get; set; }

        [JsonProperty("xsfmc")]
        public string SellerName { get; set; }

        [JsonProperty("xsfnsrsbh")]
        public string SellerTaxNo { get; set; }

        [JsonProperty("gmfmc")]
        public string PurchaserName { get; set; }

        [JsonProperty("lzfpdm")]
        public string BlueInvoiceCode { get; set; }

        [JsonProperty("lzfphm")]
        public string BlueInvoiceNumber { get; set; }

        [JsonProperty("sfzzfpbz")]
        public string PaperInvoiceFlag { get; set; }

        [JsonProperty("lzkprq")]
        public string BlueInvoiceDate { get; set; }

        [JsonProperty("lzhjje")]
        public string BlueInvoiceAmount { get; set; }

        [JsonProperty("lzhjse")]
        public string BlueInvoiceTax { get; set; }

        [JsonProperty("lzfppzDm")]
        public string BlueInvoiceType { get; set; }

        [JsonProperty("hzcxje")]
        public string RedAmount { get; set; }

        [JsonProperty("hzcxse")]
        public string RedTax { get; set; }

        [JsonProperty("hzqrdmxsl")]
        public int DetailCount { get; set; }

        [JsonProperty("chyyDm")]
        public string RedCause { get; set; }

        [JsonProperty("hzqrxxztDm")]
        public string RedConfirmStatus { get; set; }

        [JsonProperty("qrrq")]
        public string RedConfirmDate { get; set; }

        [JsonProperty("ykjhzfpbz")]
        public string IssuedRedInvoiceFlag { get; set; }

        [JsonProperty("hzfphm")]
        public string RedInvoiceNumber { get; set; }

        [JsonProperty("hzkprq")]
        public string RedInvoiceDate { get; set; }

        [JsonProperty("yxbz")]
        public string ValidFlag { get; set; }

        [JsonProperty("lrrq")]
        public string InputDate { get; set; }
    }

}
